<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title>登录</title>
    <link rel="stylesheet" href="/css/pintuer.css">
    <link rel="stylesheet" href="/css/admin.css">
    <script src="/js/jquery.js"></script>
    <script src="/js/pintuer.js"></script>
    <script src="/js/vuejs-2.5.16.js"></script>
    <script src="/js/axios-0.18.0.js"></script>
</head>
<body>
<div class="bg"></div>
<div class="container" id="app">
    <div class="line bouncein">
        <div class="xs6 xm4 xs3-move xm4-move">
            <div style="height:150px;"></div>
            <div class="media media-y margin-big-bottom">
            </div>
            <form>
                <div class="panel loginbox">
                    <div style="text-align: center"><h1>坂田联队后台管理中心</h1></div>

                </div>
                <div id="weixin" style="text-align: center">11</div>
            </form>
        </div>
    </div>
</div>
<script src="../js/wxLogin.js"></script>
<script>
    var obj = new WxLogin({
        self_redirect:false,
        id:"weixin",
        appid: "wx3bdb1192c22883f3",
        scope: "snsapi_login",
        redirect_uri: "http://note.java.itcast.cn/weixinlogin"
    });
</script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            telephone:'',
            code:'',
            url:'',
        },
        methods: {

            login(){
                axios.post("/user/login",{
                    telephone: this.telephone,
                    code:this.code,
                }).then(resp=>{
                    if (resp.data=='0') {
                        alert("验证码不正确")
                    }else if (resp.data=='1'){
                        alert("手机号还未注册")
                    } else {
                        /*把token存储到空间*/
                        localStorage.setItem("Authorization",resp.data)
                        location.href='/main.html'
                    }
                })
            },

        },
        created(){


        }
    })
</script>
</body>
</html>